<div class="resources index">
	<h2><?php echo __('Resources'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php if($this->Session->read('Auth.User.role_id')==1 || $this->Session->read('Auth.User.role_id')==2){
                        echo 'Resource ID';} ?></th>
			<th><?php echo 'Resource Name'; ?></th>
			<th><?php echo 'Description'; ?></th>
			<th><?php echo 'Catagory'; ?></th>
			<?php if($this->Session->read('Auth.User.role_id')==1 || $this->Session->read('Auth.User.role_id')==2){?>
                        <th>View</th>
                        <th>Edit</th>
                        <th>Delete</th>
                        <?php }?>
	</tr>
	<?php foreach ($resources as $resource): ?>
	<tr>
		<td><?php if($this->Session->read('Auth.User.role_id')==1 || $this->Session->read('Auth.User.role_id')==2){
                echo h($resource['Resource']['res_id']);} ?>&nbsp;</td>
		<td><?php echo h($resource['Resource']['res_name']); ?>&nbsp;</td>
		<td><?php echo h($resource['Resource']['res_desc']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($resource['Catagory']['cat_name'], array('controller' => 'catagories', 'action' => 'view', $resource['Catagory']['cat_id'])); ?>
		</td>
                <?php if($this->Session->read('Auth.User.role_id')==1 || $this->Session->read('Auth.User.role_id')==2){?>
                <td><?php echo $this->Html->image('view.png',array('alt'=>'View','url'=>array('action' => 'view', $resource['Resource']['res_id']))); ?></td>
		<td><?php echo $this->Html->image('edit.png',array('alt'=>'Edit','url'=>array('action' => 'edit', $resource['Resource']['res_id']))); ?></td>
		<td><?php echo $this->Form->postLink($this->Html->image('delete.png', array('alt'=>__('Delete'))), array('action' => 'delete', $resource['Resource']['res_id']), array('escape' =>false, __('Are you sure you want to delete # %s?', $resource['Resource']['res_id']))); ?></td>
		
                <?php }?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>
<?php if($this->Session->read('Auth.User.role_id')==1 || $this->Session->read('Auth.User.role_id')==2){?>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('New Resource'), array('action' => 'add')); ?></li>
		<li><?php echo $this->Html->link(__('List Catagories'), array('controller' => 'catagories', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Catagory'), array('controller' => 'catagories', 'action' => 'add')); ?> </li>
	</ul>
</div>
<?php }?>